package com.icloud.system.boot.controller.internal;

import com.icloud.common.web.domain.UserDto;
import com.icloud.system.boot.service.AdminUserAuthService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

@RestController
@Api(tags = "「内部」后台用户权限接口")
@RequestMapping("/admin")
@RequiredArgsConstructor
public class InternalAdminUserAuthController {

    private final AdminUserAuthService adminUserAuthService;

    @ApiOperation("根据用户名获取后台用户通用信息")
    @RequestMapping(value = "/loadByUsername", method = RequestMethod.GET)
    @ResponseBody
    public UserDto loadUserByUsername(@ApiParam("账户名")@RequestParam String username) {
        return adminUserAuthService.loadUserByUsername(username);
    }
}
